package textTests;
import globalCode.TableHandler;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;




public class TestFour {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			Class.forName("com.mysql.jdbc.Driver");
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
		
		String url = "jdbc:mysql://ischooldev.fcps.net:3306/";
		String username = "root";
		String password = "PAss33word!!";
		Statement stmt = null;
		ResultSet rs = null;
		Connection con;
		
		try {
			con = DriverManager.getConnection(url, username, password);
			stmt = con.createStatement();
			stmt.executeQuery("USE inetwork");
			
			TableHandler th = new TableHandler(con);
			
			th.runUpdates();
			
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		finally {
			if(rs!=null){
				try{
					rs.close();
				} catch(SQLException sqlEx){}
				
				rs = null;
			}
			
			if(stmt!=null){
				try{
					stmt.close();
				} catch(SQLException sqlEx){}
				
				stmt = null;
			}
		}
		
		

	}

}
